<%
 	var xaxis = plot.getAxes().xaxis;
	var lastLeft = -30;
	var lastLabel = '';
	var offset   = 0;
	var height   = 0;
	var date;

	for( var i = 0; i < dates.length; i++ )
	{
		var date = dates[i];
		if ( date[0] >= xaxis.min && date[0] < xaxis.max )
		{
			o = plot.pointOffset({ x: date[0], y: 0});

			if ( o.left - lastLeft < 7*lastLabel.length )
			{
				offset = 18;
				height = 136;				
			}
			else
			{
				offset = 0;
				height = 154;
				
				lastLeft = o.left;
				lastLabel = date[1];
			}
			%>
				<div class="important_date" style="position:absolute;left:<%=o.left%>px;top:<%=offset%>px;height:<%=height%>px"> 
					<%=date[1]%>
				</div>
			<%
		}
	}
%>